package com.hy.myapp.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.hy.myapp.Entity.User;

@Mapper
public interface UserMapper {
	@Insert(" insert into mc_user(id,name,pswd,email) values(mc_user_id_sqs.nextval,#{name},#{pswd},#{email}) ")
	int addUser(@Param("name") String name,
			    @Param("pswd") String pswd,
			    @Param("email") String email);
	
	@Select(" select * from mc_user where name=#{name} and pswd=#{pswd} ")
	User findByNamePswd(@Param("name") String name,
		                @Param("pswd") String pswd);
	
	@Select(" select * from mc_user where name=#{name} ")
	User findByName(@Param("name") String name);
	
	@Select(" select * from mc_user where email=#{email} ")
	User findByEmail(@Param("email") String email);
}
